Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2470

RelBuilder.project should combine expressions if underlying node is a Project

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.18.0
    • None
    • None

    Description

      The RelBuilder.project method should combine expressions if underlying node is a Project.

      For example, if r is a RelBuilder and its stack initially contains

      Project(Scan(T), a, b, a + b as c)

      and we call (in pseudo-code)

      r.project(a + c as d)

      then the result should be

      Project(Scan(T), a + (a + b) as d)

      Today the result is

      Project(Project(Scan(T), a, a + b as c), a + c as d)

      In some circumstances the result will be larger (i.e. contain more RexNode instances) but much more frequently the result will be smaller and simpler.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: